home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / vedt.zip / COMPILE.DEM < prev    next >
Text File  |  1990-10-17  |  8KB  |  197 lines

  1.  
  2.         DEMONSTRATING THE VEDIT COMPILER SUPPORT
  3.         ----------------------------------------
  4.  
  5. You can start up the Compiler Support from DOS with the command:
  6.  
  7.     COMPILE ADDER.C
  8.  
  9. The Compiler Support starts up with a large menu on the right half of
  10. the screen.  Displayed near the top are the current Compiler, Linker,
  11. Debugger and Make commands.  The initial commands are set by the
  12. editable COMPILE.CNF file.
  13.  
  14. NOTES:    You can override the commands in COMPILE.CNF by creating the
  15.     files COMPILE.VCO, LINK.VCO, DEBUG.VCO and MAKE.VCO in each
  16.     local directory you use for programming.  These files consist
  17.     of a single command line.  This way the correct Compiler/
  18.     Assembler is always ready to run.  COMPILE.VCO files also let
  19.     you set the Compiler options needed for each of your programs.
  20.     For example, one program may need to be compiled with the
  21.     "medium model" option while another needs the "large model"
  22.     option.  The Compiler Support will adjust automatically.
  23.  
  24.     The prompt for whether you have a color display can be turned
  25.     off by editing COMPILE.CNF and changing "COLORDISPLAY=" from
  26.     a value of "?" to "Y" or "N".
  27.  
  28. Also displayed are the current "Project File" and "Edit File"; most
  29. likely they are now the same, e.g. "ADDER.C".  The Project File is the
  30. name of the file to be compiler, linked and debugged.  The "-proj.ext"
  31. and "-proj" you see in the Compiler, Linker and Debugger commands are
  32. place holders for the Project File name, with and without extension.
  33.  
  34. The "Edit File" is the file you are editing at the moment.  It could,
  35. for example, be an "Include" file needed by the main program.
  36.  
  37.  
  38. Compiling ADDER
  39. ---------------
  40.  
  41. Assuming the current Project File is ADDER.C, you can compile it by
  42. selecting "C" from the main menu.  Your C compiler should run and
  43. report errors.  The Compiler Support should automatically load ADDER.C
  44. and position the cursor on the first line containing an error.  The
  45. reported error will also be displayed on the screen.  Correct the
  46. first error by changing "num0" to "num1".  Press <ESC> for the "Error
  47. menu":
  48.  
  49. (N)ext  (P)revious  (F)irst  (B)rowse  (R)ecompile  (E)xit to Menu
  50.  
  51. Press "N" to advance to the next error.  ("Browse" lets you see all
  52. errors and select a desired error.)  Correct the error as described in
  53. the comment.  Press <ESC> and "N" again.  "No more errors" is
  54. displayed.  Press "R" to recompile.  The compilation should now be
  55. successful.  If indicated, press <ESC> to return to the main menu.
  56.  
  57.  
  58. Linking ADDER
  59. -------------
  60.  
  61. The program ADDER is now ready for linking.  Select "L" from the main
  62. menu.
  63.  
  64. The linker's output is displayed on the screen for you; press <ESC> to
  65. return to the main menu.
  66.  
  67. NOTE:    The Microsoft and Borland C Compilers also let you compile and
  68.     link in one step, but we have purposely broken it into
  69.     distinct compile and link steps.  One advantage is that the
  70.     Microsoft "/codeview" option is only available with the LINK
  71.     command.)
  72.  
  73.  
  74. Running / Debugging ADDER
  75. -------------------------
  76.  
  77. You can now run ADDER by selecting "G" from the main menu and at the
  78. prompt typing "ADDER".
  79.  
  80. In practice, you can run your debugger by selecting "D" from the main
  81. menu.
  82.  
  83.  
  84. Assembling EGA43
  85. ----------------
  86.  
  87. Change the current Compiler by selecting "S" from the main menu.  At
  88. the filename prompt simply press <Enter> for Point & Shoot file
  89. selection.  Select either "MASM" or "TASM".
  90.  
  91. NOTES:    When you select a new compiler, the Compiler Support loads the
  92.     associated ".VCS" file, e.g. "MASM.VCS" or "TASM.VCS".  Each
  93.     supported compiler has an associated ".VCS" file.  VEDIT
  94.     supports numerous other compilers.  Users can also create
  95.     their own ".VCS" files for custom compilers.
  96.  
  97.     The Compiler Support also loads the associated ".VCO" file,
  98.     e.g. "MASM.VCO" or "TASM.VCO".  The ".VCO" file contains the
  99.     new Compiler command you see displayed in the menu.  It can
  100.     also set new Linker, Debugger and Make commands.  In this
  101.     demo, it only sets the Compiler and Linker commands.
  102.  
  103. To assemble EGA43.ASM select "P" from the main menu.  At the filename
  104. prompt simply press <Enter>.  Select EGA43.ASM.
  105.  
  106. To assemble EGA43.ASM select "C" from the main menu.  EGA43.ASM also
  107. contains several obvious syntactic errors which need correction.
  108. Using the same procedure as with ADDER.C, correct the errors and
  109. re-assemble the program until no further errors are reported.
  110.  
  111.  
  112. Linking EGA43
  113. -------------
  114.  
  115. When you selected a new compiler (assembler) above, it changed both
  116. the Compiler and Linker commands.  The Linker command should now be
  117. set to "LINK /codeview -proj.obj;" or "TLINK -proj.obj" for the
  118. Microsoft or Borland linkers, respectively.
  119.  
  120. If you want to experiment with changing the Linker command, follow
  121. these steps:
  122.  
  123.     Select "O" from the main menu.  Select "L" from the "Change
  124.     Options" sub-menu to change the Link command.  Select "E" to edit
  125.     the command.  Edit the command as needed.  Press <Esc>.  Select
  126.     "X" twice to return to the main menu.
  127.  
  128. Select "L" from the main menu to run the linker.
  129.  
  130. Running EGA43
  131. -------------
  132.  
  133. You can now run EGA43 by selecting "G" from the main menu and at the
  134. prompt entering "EGA43".
  135.  
  136. You may want to restore the screen back to 25 lines by selecting "G"
  137. from the main menu and at the prompt entering "MODE CO80".
  138.  
  139.  
  140. Running Make
  141. ------------
  142.  
  143. This discussion assumes you are familiar with Make programs and
  144. "makefiles".
  145.  
  146. The Microsoft NMAKE and Borland MAKE programs are supported.  Using a
  147. "makefile" simplifies not only general program development, but also
  148. use of the Compiler Support.  The supplied makefile "MAKEFILE" will
  149. compile/assemble and link both ADDER.C and EGA43.ASM.  The Compiler
  150. Support automatically handles any errors reported by different
  151. compilers/assemblers used during the Make process.
  152.  
  153. The displayed Make command is "NMAKE /n" for Microsoft and "MAKE -n"
  154. for Borland.  The default makefile for each is "MAKEFILE".
  155.  
  156. To try the Make process first delete the files ADDER.OBJ, ADDER.EXE,
  157. EGA43.OBJ and EGA43.COM created by compiling and linking above.  You
  158. may want to reintroduce some errors in ADDER.C and EGA43.ASM.
  159.  
  160. Start the Make process by selecting "M" from the main menu.  The
  161. Compiler Support will display any errors reported by the compiler or
  162. assembler as before.  After correcting an error and pressing <ESC>, a
  163. different "Error menu" is displayed:
  164.  
  165. (N)ext (P)rev (F)irst (B)rowse (M)ake (R)etry (S)kip (E)xit to Menu
  166.  
  167. Press "R" to retry the current compilation.  "(M)ake" restarts the
  168. entire Make process.  "(S)kip" skips the current compilation and
  169. continues with the rest of the Make process.
  170.  
  171. When running Make, it is irrelevant what the current Compiler and
  172. Linker commands displayed in the Compiler Support's menu are.  The
  173. Make process is completely controlled by the makefile.  The Compiler
  174. Support automatically loads the appropriate ".VCS" files to handle any
  175. errors reported by a compiler or assembler.
  176.  
  177.  
  178. In practice, its simple
  179. -----------------------
  180.  
  181. In practice, you would set up COMPILE.VCO, LINK.VCO, DEBUG.VCO and
  182. "makefile" files for each of your major programs.  It would then no
  183. longer be necessary to switch compilers and change Compiler and Link
  184. commands from within the Compiler Support.  You would simply start up
  185. the Compiler Support in the program's directory and the Compile/Link
  186. commands would adjust automatically.
  187.  
  188. The Compiler Support is normally used in conjunction with our V-SWAP
  189. program.  When V-SWAP is loaded, you can start up the Compiler Support
  190. at any time from within VEDIT by pressing <ALT-I>.  The current file
  191. you are editing becomes the Project and Edit File, ready for
  192. compilation.  V-SWAP will completely swap VEDIT out of memory in order
  193. to run the most memory demanding compilers and debuggers.
  194.  
  195. We hope that you have enjoyed the Compiler Support portion of the
  196. VEDIT PLUS demo/tutorial.
  197.